package com.zt.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.zt.mapper.CardBindingMapper;
import com.zt.system.Withdrawal;
import com.zt.service.WithdrawalService;
import com.zt.mapper.WithdrawalMapper;
import com.zt.user.UserFeign;
import com.zt.utils.Result;
import com.zt.vo.CardBindingVo;
import com.zt.vo.TransactionRecordVo;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
* @author 不.凌
* @description 针对表【withdrawal】的数据库操作Service实现
* @createDate 2024-09-03 17:43:26
*/
@Service
public class WithdrawalServiceImpl extends ServiceImpl<WithdrawalMapper, Withdrawal>
    implements WithdrawalService{

    @Resource
    private UserFeign userFeign;

    @Override
    public Result pageCardBinding(TransactionRecordVo transactionRecordVo) {
        Page<Withdrawal> page = new Page<>(transactionRecordVo.getPageNum(),transactionRecordVo.getPageSize());
        LambdaQueryWrapper<Withdrawal> wrapper = new LambdaQueryWrapper<>();
        this.page(page,wrapper);
        for (Withdrawal record : page.getRecords()) {
            String name = userFeign.getUserById(record.getUserId());
            record.setName(name);
        }
        return Result.success(page);
    }
}





